<template>
  <div class="header-box">
    <div class="header-left">
      <el-button link type="primary" @click="goBack">
        {{ '< 返回' }}
      </el-button>
      <el-divider direction="vertical" />
      <span class="desc-title">{{ title }}</span>
    </div>
    <div class="header-right">
      <div v-if="$slots.right" class="flex">
        <slot name="right"></slot>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      title: {
        type: String,
        default: '',
      },
    },
    emits: [],
    data() {
      return {};
    },
    methods: {
      goBack() {
        this.$router.go(-1);
      },
    },
  };
</script>

<style lang="scss" scoped>
  .header-box {
    height: 56px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #fff;
    .header-left {
      .desc-title {
        font-weight: 500;
        font-size: 16px;
        line-height: 140%;
        color: #000000;
      }
    }
  }
</style>
